ボットが 1 つのコマンド discord.py に複数回応答する問題 (Issue with bot responding multiple times to one command discord.py)


問題の説明

ボットが 1 つのコマンド discord.py に複数回応答する問題 (Issue with bot responding multiple times to one command discord.py)

コンソールを 1 つしか開いていません。これは on_message が原因だと思います。これらを削除すると、本来のように 1 回しか応答しないからです。私は後に await self.client.process_commands(message) を使用しているので、なぜそれが繰り返されるのか本当にわかりません。何か提案があれば教えてください。


リファレンスソリューション

方法 1:

I thenk you are using Cog and Cog.listener().

event and listener in discord.py is 2 different decorator. for example listeners called in events.

remove this line:

await self.client.process_commands(message)

(by pythonguyDelta)

リファレンスドキュメント

  1. Issue with bot responding multiple times to one command discord.py (CC BY‑SA 2.5/3.0/4.0)

#discord.py #Python #discord #python-3.x






関連する質問

ボットを特定のギルドから脱退させるコマンド: discord.py rewrite (Command to make my bot leave a specific guild: discord.py rewrite)

コルーチンを待機し、結果をコルーチン外の変数に代入する (Awaiting a coroutine and assigning the result to a variable outside of a coroutine)

json Discord.py 内の特定のデータを削除する (Delete specific data in json Discord.py)

埋め込みメッセージへの絵文字の追加 (Adding an emoji to an embed message)

github にコミットする Discord ボット (Discord bot that commits to github)

ctx.bot.get_userがctxでdiscord.pyで使用できない (ctx.bot.get_user unable in ctx to use while in discord.py)

discord.py ギルドのメンバーの最初のメッセージを見つける (discord.py find first message of a member in a guild)

ボットがオーディオを再生しているかどうかを確認し、そうでない場合は自動的に次の曲を再生する方法はありますか? (Is there a way to check if a bot is playing audio and if not, automatically play the next song?)

youtube_dl - エラー ログの投稿を防止できない (youtube_dl - Cannot prevent error logs from posting)

ボットが 1 つのコマンド discord.py に複数回応答する問題 (Issue with bot responding multiple times to one command discord.py)

言及されたときにカスタムプレフィックスを取得する方法 (How to get custom prefix with when mentioned)

特定のユーザーを追加して、discord.py でテキスト チャンネルを表示できるようにします (Add specific user's to be able to view text channel with discord.py)







コメント